import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/home',
      name: 'home',
      component: HomeView,
      meta: {
        title: '首页'
      }
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('../views/AboutView.vue'),
      meta: {
        title: '递归组件'
      }
    },
    {
      path: '/fatherAndChild',
      name: 'fatherAndChild',
      component: () => import('../views/fatherAndChild.vue'),
      meta: {
        title: '父子传参'
      }
    },
    {
      path: '/DynamicCom',
      name: 'DynamicCom',
      component: () => import('../views/DynamicCom.vue'),
      meta: {
        title: '动态组件'
      }
    },
    {
      path: '/conveyor',
      name: 'conveyor',
      component: () => import('../views/conveyor.vue'),
      meta: {
        title: '传送组件'
      }
    },
    {
      path: '/brothers',
      name: 'brothers',
      component: () => import('../views/Bus.vue'),
      meta: {
        title: '兄弟传值'
      }
    },
    {
      path: '/vModel',
      name: 'vModel',
      component: () => import('../views/vModel.vue'),
      meta: {
        title: 'v-model合集'
      }
    },
    {
      path: '/directive',
      name: 'directive',
      component: () => import('../views/directive.vue'),
      meta: {
        title: '自定义指令案例'
      }
    },
    {
      path: '/lazy',
      name: 'lazy',
      component: () => import('../views/lazy/lazy.vue'),
      meta: {
        title: '自定义指令-图片懒加载'
      }
    },
    {
      path: '/hooks',
      name: 'hooks',
      component: () => import('../views/hooks.vue'),
      meta: {
        title: 'hooks的使用-图片转base64'
      }
    },
    {
      path: '/loding',
      name: 'loding',
      component: () => import('../views/Loding.vue'),
      meta: {
        title: '自定义vue插件 loding'
      }
    },
    {
      path:'/chat',
      name:'chat',
      component:() => import('../views/chat.vue'),
      meta:{
         title: 'AI问答'
      }
    },
    {
      path:'/map',
      name:'地图',
      component:() => import('../views/map.vue'),
      meta:{
        title: '地图'
     }
    }
  ]
})

export default router
